package com.example.homeworkmutualevaluation.Service;

import com.example.homeworkmutualevaluation.Dao.RefanswerDao;
import com.example.homeworkmutualevaluation.Entity.Refanswer;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class RefanswerService {
    @Resource
    private RefanswerDao refanswerDao;
    public Refanswer findByHomeworkid(int homeworkid) {
        return refanswerDao.findByHomeworkid(homeworkid);
    }
    public void setContent(int homeworkid, String content) {
        Refanswer refanswer = new Refanswer();
        refanswer.setHomeworkid(homeworkid);
        refanswer.setContent(content);
        refanswerDao.save(refanswer);
    }
}
